package com.ruoyi.testfunction.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.testfunction.domain.dao.DailyFunctionDTO;
import com.ruoyi.testfunction.domain.vo.DailyFunctionVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.testfunction.mapper.DailyFunctionMapper;
import com.ruoyi.testfunction.domain.DailyFunction;
import com.ruoyi.testfunction.service.IDailyFunctionService;

/**
 * 用户日常功能Service业务层处理
 *
 * @author LF
 * @date 2024-03-04
 */
@Service
public class DailyFunctionServiceImpl extends ServiceImpl<DailyFunctionMapper,DailyFunction> implements IDailyFunctionService {
    @Autowired
    private DailyFunctionMapper dailyFunctionMapper;

    @Override
    public List<DailyFunctionVO> pageList(DailyFunctionDTO dto) {
        return dailyFunctionMapper.pageList(dto);
    }

    /**
     * 查询用户日常功能
     *
     * @param id 用户日常功能主键
     * @return 用户日常功能
     */
    @Override
    public DailyFunctionVO selectDailyFunctionById(Long id) {
        return dailyFunctionMapper.selectDailyFunctionById(id);
    }

    /**
     * 查询用户日常功能列表
     *
     * @param dailyFunction 用户日常功能
     * @return 用户日常功能
     */
    @Override
    public List<DailyFunction> selectDailyFunctionList(DailyFunction dailyFunction) {
        return dailyFunctionMapper.selectDailyFunctionList(dailyFunction);
    }

    /**
     * 新增用户日常功能
     *
     * @param dailyFunction 用户日常功能
     * @return 结果
     */
    @Override
    public int insertDailyFunction(DailyFunction dailyFunction) {
        dailyFunction.setCreateTime(DateUtils.getNowDate());
        return dailyFunctionMapper.insertDailyFunction(dailyFunction);
    }

    /**
     * 修改用户日常功能
     *
     * @param dailyFunction 用户日常功能
     * @return 结果
     */
    @Override
    public int updateDailyFunction(DailyFunction dailyFunction) {
        dailyFunction.setUpdateTime(DateUtils.getNowDate());
        return dailyFunctionMapper.updateDailyFunction(dailyFunction);
    }

    /**
     * 批量删除用户日常功能
     *
     * @param ids 需要删除的用户日常功能主键
     * @return 结果
     */
    @Override
    public int deleteDailyFunctionByIds(Long[] ids) {
        return dailyFunctionMapper.deleteDailyFunctionByIds(ids);
    }

    /**
     * 删除用户日常功能信息
     *
     * @param id 用户日常功能主键
     * @return 结果
     */
    @Override
    public int deleteDailyFunctionById(Long id) {
        return dailyFunctionMapper.deleteDailyFunctionById(id);
    }

}
